package com.ljkj.cordial.lengthtcpheartbeat;

import com.lanjiu.lib.communication.IMSConfig;
import com.lanjiu.pro.business.BusinessProtocolMessageStandard;
import com.lanjiu.pro.business.BusinessProtocolMessages;

/**
 * 响应消息监听管理
 */
public abstract class ResponseChat {
    private BusinessProtocolMessageStandard.Head head;

    public BusinessProtocolMessageStandard.Head getHead() {
        return head;
    }

    public void setHead(BusinessProtocolMessageStandard.Head head) {
        this.head = head;
    }

    public void onRegisteredUserProtocol(BusinessProtocolMessageStandard.UnifiedEntranceMessage.DataType dataType, String msgType, BusinessProtocolMessages.RegisteredUserProtocol response) {
    }


    public void onLoginProtocol(BusinessProtocolMessageStandard.UnifiedEntranceMessage.DataType dataType, String msgType, BusinessProtocolMessages.LoginProtocol response) {
    }


    public void onLogoutProtocol(BusinessProtocolMessageStandard.UnifiedEntranceMessage.DataType dataType, String msgType, BusinessProtocolMessages.LogoutProtocol response) {
    }


    public void onFindUserProtocol(BusinessProtocolMessageStandard.UnifiedEntranceMessage.DataType dataType, String msgType, BusinessProtocolMessages.FindUserProtocol response) {
    }


    public void onFriendListProtocol(BusinessProtocolMessageStandard.UnifiedEntranceMessage.DataType dataType, String msgType, BusinessProtocolMessages.FriendListProtocol response) {
    }


    public void onFriendInfoProtocol(BusinessProtocolMessageStandard.UnifiedEntranceMessage.DataType dataType, String msgType, BusinessProtocolMessages.FriendInfoProtocol response) {
    }


    public void onFriendOnlineStatusChangeProtocol(BusinessProtocolMessageStandard.UnifiedEntranceMessage.DataType dataType, String msgType, BusinessProtocolMessages.FriendOnlineStatusChangeProtocol response) {
    }


    public void onFriendAddProtocol(BusinessProtocolMessageStandard.UnifiedEntranceMessage.DataType dataType, String msgType, BusinessProtocolMessages.FriendAddProtocol response) {
    }


    public void onFriendDeleteProtocol(BusinessProtocolMessageStandard.UnifiedEntranceMessage.DataType dataType, String msgType, BusinessProtocolMessages.FriendDeleteProtocol response) {
    }


    public void onFindGroupProtocol(BusinessProtocolMessageStandard.UnifiedEntranceMessage.DataType dataType, String msgType, BusinessProtocolMessages.FindGroupProtocol response) {
    }


    public void onGroupListProtocol(BusinessProtocolMessageStandard.UnifiedEntranceMessage.DataType dataType, String msgType, BusinessProtocolMessages.GroupListProtocol response) {
    }


    public void onGroupCreateProtocol(BusinessProtocolMessageStandard.UnifiedEntranceMessage.DataType dataType, String msgType, BusinessProtocolMessages.GroupCreateProtocol response) {
    }


    public void onGroupInfoProtocol(BusinessProtocolMessageStandard.UnifiedEntranceMessage.DataType dataType, String msgType, BusinessProtocolMessages.GroupInfoProtocol response) {
    }


    public void onGroupMemberOnlineStatusChangeProtocol(BusinessProtocolMessageStandard.UnifiedEntranceMessage.DataType dataType, String msgType, BusinessProtocolMessages.GroupMemberOnlineStatusChangeProtocol response) {
    }


    public void onGroupMemberAddProtocol(BusinessProtocolMessageStandard.UnifiedEntranceMessage.DataType dataType, String msgType, BusinessProtocolMessages.GroupMemberAddProtocol response) {
    }


    public void onGroupMemberDeleteProtocol(BusinessProtocolMessageStandard.UnifiedEntranceMessage.DataType dataType, String msgType, BusinessProtocolMessages.GroupMemberDeleteProtocol response) {
    }


    public void onGroupAnnouncementProtocol(BusinessProtocolMessageStandard.UnifiedEntranceMessage.DataType dataType, String msgType, BusinessProtocolMessages.GroupAnnouncementProtocol response) {
    }


    public void onPersonalInfoProtocol(BusinessProtocolMessageStandard.UnifiedEntranceMessage.DataType dataType, String msgType, BusinessProtocolMessages.PersonalInfoProtocol response) {
    }


    public void onPersonalSettingsProtocol(BusinessProtocolMessageStandard.UnifiedEntranceMessage.DataType dataType, String msgType, BusinessProtocolMessages.PersonalSettingsProtocol response) {
    }


    public void onFriendSettingsProtocol(BusinessProtocolMessageStandard.UnifiedEntranceMessage.DataType dataType, String msgType, BusinessProtocolMessages.FriendSettingsProtocol response) {
    }


    public void onGroupSettingsProtocol(BusinessProtocolMessageStandard.UnifiedEntranceMessage.DataType dataType, String msgType, BusinessProtocolMessages.GroupSettingsProtocol response) {
    }


    public void onGroupMemberSettingsProtocol(BusinessProtocolMessageStandard.UnifiedEntranceMessage.DataType dataType, String msgType, BusinessProtocolMessages.GroupMemberSettingsProtocol response) {
    }


    public void onNotificationsProtocol(BusinessProtocolMessageStandard.UnifiedEntranceMessage.DataType dataType, String msgType, BusinessProtocolMessages.NotificationsProtocol response) {
    }


    public void onSysNotifyProtocol(BusinessProtocolMessageStandard.UnifiedEntranceMessage.DataType dataType, String msgType, BusinessProtocolMessages.SysNotifyProtocol response) {
    }


    public void onUserNotifyProtocol(BusinessProtocolMessageStandard.UnifiedEntranceMessage.DataType dataType, String msgType, BusinessProtocolMessages.UserNotifyProtocol response) {
    }


    public void onFriendChatProtocol(BusinessProtocolMessageStandard.UnifiedEntranceMessage.DataType dataType, String msgType, BusinessProtocolMessages.FriendChatProtocol response) {
    }


    public void onGroupChatProtocol(BusinessProtocolMessageStandard.UnifiedEntranceMessage.DataType dataType, String msgType, BusinessProtocolMessages.GroupChatProtocol response) {
    }


    public void onDelFriendOffMessageProtocol(BusinessProtocolMessageStandard.UnifiedEntranceMessage.DataType dataType, String msgType, BusinessProtocolMessages.DelFriendOffMessageProtocol response) {
    }

    public void onDelGroupMessageProtocol(BusinessProtocolMessageStandard.UnifiedEntranceMessage.DataType dataType, String msgType, BusinessProtocolMessages.DelGroupOffMessageProtocol response) {
    }


    public void onOffFriendMessageListProtocol(BusinessProtocolMessageStandard.UnifiedEntranceMessage.DataType dataType, String msgType, BusinessProtocolMessages.OffFriendMessageListProtocol response) {
    }

    public void onMessageClearProtocol(BusinessProtocolMessageStandard.UnifiedEntranceMessage.DataType dataType, String msgType, BusinessProtocolMessageStandard.Head response) {
    }

    public void onFailed(String msgType) {
    }

    public void onTrans(BusinessProtocolMessageStandard.UnifiedEntranceMessage b) {
        head = b.getHead();
//        if (!IMSConfig.STATUS_REPORT_SUCCESS.equals(head.getStatusReport())) {
//            onFailed(head.getMsgType());
//            return;
//        }
        String msgType = head.getMsgType();
        if (b.getDataType() == null) {
            return;
        }
        String statusReport = head.getStatusReport();
        if (IMSConfig.STATUS_REPORT_FAILURE.equals(statusReport)) {
            return;
        }
        BusinessProtocolMessageStandard.UnifiedEntranceMessage.DataType dataType = b.getDataType();
        switch (dataType) {
            case RegisteredUserProtocol:
                onRegisteredUserProtocol(dataType, msgType, b.getRegisteredUserProtocol());
                break;
            case LoginProtocol:
                onLoginProtocol(dataType, msgType, b.getLoginProtocol());
                break;
            case LogoutProtocol:
                onLogoutProtocol(dataType, msgType, b.getLogoutProtocol());
                break;
            case FindUserProtocol:
                onFindUserProtocol(dataType, msgType, b.getFindUserProtocol());
                break;
            case FriendListProtocol:
                onFriendListProtocol(dataType, msgType, b.getFriendListProtocol());
                break;
            case FriendInfoProtocol:
                onFriendInfoProtocol(dataType, msgType, b.getFriendInfoProtocol());
                break;
            case FriendOnlineStatusChangeProtocol:
                onFriendOnlineStatusChangeProtocol(dataType, msgType, b.getFriendOnlineStatusChangeProtocol());
                break;
            case FriendAddProtocol:
                onFriendAddProtocol(dataType, msgType, b.getFriendAddProtocol());
                break;
            case FriendDeleteProtocol:
                onFriendDeleteProtocol(dataType, msgType, b.getFriendDeleteProtocol());
                break;
            case FindGroupProtocol:
                onFindGroupProtocol(dataType, msgType, b.getFindGroupProtocol());
                break;
            case GroupListProtocol:
                onGroupListProtocol(dataType, msgType, b.getGroupListProtocol());
                break;
            case GroupCreateProtocol:
                onGroupCreateProtocol(dataType, msgType, b.getGroupCreateProtocol());
                break;
            case GroupInfoProtocol:
                onGroupInfoProtocol(dataType, msgType, b.getGroupInfoProtocol());
                break;
            case GroupMemberOnlineStatusChangeProtocol:
                onGroupMemberOnlineStatusChangeProtocol(dataType, msgType, b.getGroupMemberOnlineStatusChangeProtocol());
                break;
            case GroupMemberAddProtocol:
                onGroupMemberAddProtocol(dataType, msgType, b.getGroupMemberAddProtocol());
                break;
            case GroupMemberDeleteProtocol:
                onGroupMemberDeleteProtocol(dataType, msgType, b.getGroupMemberDeleteProtocol());
                break;
            case GroupAnnouncementProtocol:
                onGroupAnnouncementProtocol(dataType, msgType, b.getGroupAnnouncementProtocol());
                break;
            case PersonalInfoProtocol:
                onPersonalInfoProtocol(dataType, msgType, b.getPersonalInfoProtocol());
                break;
            case PersonalSettingsProtocol:
                onPersonalSettingsProtocol(dataType, msgType, b.getPersonalSettingsProtocol());
                break;
            case FriendSettingsProtocol:
                onFriendSettingsProtocol(dataType, msgType, b.getFriendSettingsProtocol());
                break;
            case GroupSettingsProtocol:
                onGroupSettingsProtocol(dataType, msgType, b.getGroupSettingsProtocol());
                break;
            case GroupMemberSettingsProtocol:
                onGroupMemberSettingsProtocol(dataType, msgType, b.getGroupMemberSettingsProtocol());
                break;
            case NotificationsProtocol:
                onNotificationsProtocol(dataType, msgType, b.getNotificationsProtocol());
                break;
            case SysNotifyProtocol:
                onSysNotifyProtocol(dataType, msgType, b.getSysNotifyProtocol());
                break;
            case UserNotifyProtocol:
                onUserNotifyProtocol(dataType, msgType, b.getUserNotifyProtocol());
                break;
            case FriendChatProtocol:
                onFriendChatProtocol(dataType, msgType, b.getFriendChatProtocol());
                break;
            case GroupChatProtocol:
                onGroupChatProtocol(dataType, msgType, b.getGroupChatProtocol());
                break;
            case DelFriendOffMessageProtocol:
                onDelFriendOffMessageProtocol(dataType, msgType, b.getDelFriendOffMessageProtocol());
                break;
            case DelGroupOffMessageProtocol:
                onDelGroupMessageProtocol(dataType, msgType, b.getDelGroupOffMessageProtocol());
                break;
            case MessageClearProtocol:
                onMessageClearProtocol(dataType, msgType, b.getHead());
                break;
        }
    }
}
